package com.hao.demo.zoo.client.controller;

import com.hao.demo.zoo.client.grpc.DepotsOperateLogGrpcService;
import com.hao.demo.zoo.entity.DepotsOperateLogEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description: TODO
 * @Author Hao
 * @Date 2021/6/3 15:05
 * @Version 2.0
 */
@RestController
@RequestMapping("/log")
public class DepotsOperateLogController {
    @Autowired
    private DepotsOperateLogGrpcService depotsOperateLogGrpcService;

    @GetMapping("/getById")
    public List<DepotsOperateLogEntity> getById(@RequestParam("businessId") Integer businessId) {
        List<DepotsOperateLogEntity> res = depotsOperateLogGrpcService.getByBusinessId(businessId);

        return res;
    }
}
